<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddPaymentNo extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('payments', function (Blueprint $table) {
            //
            $table->string('trade_no', 100)->nullable()->comment('业务单号');
            $table->string('transaction_no', 100)->nullable()->comment('第三方单号');
            $table->integer('channel_id')->default(0)->comment('代付ID');
            $table->string('response', 1000)->nullable()->comment('响应数据');
            $table->integer('status')->default(0)->comment('状态');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('payments', function (Blueprint $table) {
            //
            $table->dropColumn('trade_no');
            $table->dropColumn('transaction_no');
            $table->dropColumn('channel_id');
            $table->dropColumn('response');
            $table->dropColumn('status');
        });
    }
}
